package com.my.hotel.service.impl;

import com.my.hotel.entity.serverPage.JdUser;
import com.my.hotel.mapper.ClientMapper;
import com.my.hotel.service.ClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClientServiceImpl implements ClientService {
    @Autowired
    ClientMapper clientMapper;
    public List<JdUser> getList() {
        return clientMapper.getList();
    }

    public void addClient(JdUser client) {
        clientMapper.addClient(client);
    }

    public void delClient(int delId) {
        clientMapper.delClient(delId);
    }

    public JdUser getClientById(int id) {
        return clientMapper.getClientById(id);
    }

    public void clientUpdate(JdUser client) {
        clientMapper.clientUpdate(client);
    }

    public boolean checkUsername(String username) {
        return clientMapper.getCountByName(username)==0;
    }
}
